<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Tcl_UtfToUpper manual page - Tcl Library Procedures</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tcl C API</a> <small>&gt;</small> ToUpper</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="ToUpper.htm#M2" NAME="L832">NAME</A>
<DL><DD>Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_UtfToLower, Tcl_UtfToTitle &mdash; routines for manipulating the case of Unicode characters and UTF-8 strings</DD></DL>
<DD><A HREF="ToUpper.htm#M3" NAME="L833">SYNOPSIS</A>
<DL>
<DD><B>#include &lt;tcl.h&gt;</B>
<DD>Tcl_UniChar
<DD><B>Tcl_UniCharToUpper</B>(<I>ch</I>)
<DD>Tcl_UniChar
<DD><B>Tcl_UniCharToLower</B>(<I>ch</I>)
<DD>Tcl_UniChar
<DD><B>Tcl_UniCharToTitle</B>(<I>ch</I>)
<DD>int
<DD><B>Tcl_UtfToUpper</B>(<I>str</I>)
<DD>int
<DD><B>Tcl_UtfToLower</B>(<I>str</I>)
<DD>int
<DD><B>Tcl_UtfToTitle</B>(<I>str</I>)
</DL>
<DD><A HREF="ToUpper.htm#M4" NAME="L834">ARGUMENTS</A>
<DL class="arguments">
</DL>
<DD><A HREF="ToUpper.htm#M5" NAME="L835">DESCRIPTION</A>
<DD><A HREF="ToUpper.htm#M6" NAME="L836">BUGS</A>
<DD><A HREF="ToUpper.htm#M7" NAME="L837">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_UtfToLower, Tcl_UtfToTitle &mdash; routines for manipulating the case of Unicode characters and UTF-8 strings
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>#include &lt;tcl.h&gt;</B><BR>
<A HREF="../TclLib/Utf.htm">Tcl_UniChar</A><BR>
<B>Tcl_UniCharToUpper</B>(<I>ch</I>)<BR>
<A HREF="../TclLib/Utf.htm">Tcl_UniChar</A><BR>
<B>Tcl_UniCharToLower</B>(<I>ch</I>)<BR>
<A HREF="../TclLib/Utf.htm">Tcl_UniChar</A><BR>
<B>Tcl_UniCharToTitle</B>(<I>ch</I>)<BR>
int<BR>
<B>Tcl_UtfToUpper</B>(<I>str</I>)<BR>
int<BR>
<B>Tcl_UtfToLower</B>(<I>str</I>)<BR>
int<BR>
<B>Tcl_UtfToTitle</B>(<I>str</I>)<BR>
<H3><A NAME="M4">ARGUMENTS</A></H3>
<DL class="arguments">
<DT>int <B>ch</B> (in)<DD>
The Unicode character to be converted.
<P><DT>char <B>*str</B> (in/out)<DD>
Pointer to UTF-8 string to be converted in place.
<P></DL>
<H3><A NAME="M5">DESCRIPTION</A></H3>
The first three routines convert the case of individual Unicode characters:
<P>
If <I>ch</I> represents a lower-case character,
<B>Tcl_UniCharToUpper</B> returns the corresponding upper-case
character.  If no upper-case character is defined, it returns the
character unchanged.
<P>
If <I>ch</I> represents an upper-case character,
<B>Tcl_UniCharToLower</B> returns the corresponding lower-case
character.  If no lower-case character is defined, it returns the
character unchanged.
<P>
If <I>ch</I> represents a lower-case character,
<B>Tcl_UniCharToTitle</B> returns the corresponding title-case
character.  If no title-case character is defined, it returns the
corresponding upper-case character.  If no upper-case character is
defined, it returns the character unchanged.  Title-case is defined
for a small number of characters that have a different appearance when
they are at the beginning of a capitalized word.
<P>
The next three routines convert the case of UTF-8 strings in place in
memory:
<P>
<B>Tcl_UtfToUpper</B> changes every UTF-8 character in <I>str</I> to
upper-case.  Because changing the case of a character may change its
size, the byte offset of each character in the resulting string may
differ from its original location.  <B>Tcl_UtfToUpper</B> writes a null
byte at the end of the converted string.  <B>Tcl_UtfToUpper</B> returns
the new length of the string in bytes.  This new length is guaranteed
to be no longer than the original string length.
<P>
<B>Tcl_UtfToLower</B> is the same as <B>Tcl_UtfToUpper</B> except it
turns each character in the string into its lower-case equivalent.
<P>
<B>Tcl_UtfToTitle</B> is the same as <B>Tcl_UtfToUpper</B> except it
turns the first character in the string into its title-case equivalent
and all following characters into their lower-case equivalents.

<H3><A NAME="M6">BUGS</A></H3>
At this time, the case conversions are only defined for the Unicode
plane 0 characters.  The result for Unicode characters above 0xFFFF
is undefined, but - actually - only the lower 16 bits of the
character value is handled.

<H3><A NAME="M7">KEYWORDS</A></H3>
<A href="../Keywords/U.htm#utf">utf</A>, <A href="../Keywords/U.htm#unicode">unicode</A>, <A href="../Keywords/T.htm#toupper">toupper</A>, <A href="../Keywords/T.htm#tolower">tolower</A>, <A href="../Keywords/T.htm#totitle">totitle</A>, <A href="../Keywords/C.htm#case">case</A>
<div class="copy">Copyright &copy; 1997 Sun Microsystems, Inc.
</div>
</BODY></HTML>
